import { IController } from "../interfaces/IController";
// import { Cache } from "../../game/cache/Cache";
import { IView } from "../interfaces/IView";
//class Controller

export class Controller implements IController {
  constructor() {
    // this.cache = Cache.instance;
    this.initServer();
    return;
  }

  public get view(): IView {
    if (this._view == null) {
      this._view = this.initView();
    }
    return this._view;
  }

  public set view(arg1: IView) {
    this._view = arg1;
    return;
  }

  protected initServer(): void {
    return;
  }

  protected initView(): IView {
    return this._view;
  }

  public get isViewShow() {
    return this._view && !this._view.isHide;
  }

  public popup(): void {
    return;
  }

  protected /* var */ cache: any/* Cache */;

  protected /* var */ _view!: IView;
}
